
<%@ include file="/common/taglibs.jsp"%>
<!--分页查询共用的页面-->
<%@ include file="/common/common.jsp"%>
<%@ page language="java" pageEncoding="UTF-8"%>

<script type="text/javascript" src="<%=jsPath%>/jquery/jquery.timers.js"></script><!--定时器-->
<script type="text/javascript" src="<%=jsPath%>/terminalCommand.js"></script><!--终端命令结果查询-->
	
<script>
$().ready(function() {
	 $("#entityForm").validate(); //初始化验证信息
	 Utility.ajaxSubmitForm("entityForm", {
						 success:function(responseText)
						 {
							   var result = responseText;
								if (result.success) {
									 var commandId = result.data; //下发成功后，获取到命令Id
									 TerminalCommand.startQueryResult(commandId);//命令下发成功,根据命令id,开始尝试获取检索结果
								}
								else {
									$(".commandMsg").html("提交失败! 错误原因：" + (result.message ? result.message : result.Data));
									//停止所有的在$('body')上定时器  
									$('body').stopTime ();  
								  }
						 }
	 });
});
function checkForm(){
	try {
		// console.log("校验参数");
		if(isNaN(parseInt($("#param_1").val())))
		{
			return false;
		}
		if(isNaN(parseInt($("#param_2").val())))
		{
			return false;
		}
		if(isNaN(parseInt($("#param_3").val())))
		{
			return false;
		}
		if(isNaN(parseInt($("#param_4").val())))
		{
			return false;
		}
		$("#param_1_value").val(parseInt($("#param_1").val()) * 60);//设置参数2的值为原值*60
		$("#param_2_value").val(parseInt($("#param_2").val()) * 60);//设置参数2的值为原值*60
		$("#param_3_value").val(parseInt($("#param_3").val()) * 60);//设置参数3的值为原值*60
		$("#param_4_value").val(parseInt($("#param_4").val()) * 60);//设置参数4的值为原值*60
	} catch (error) {
		console.error("设置参数错误："+error);
		return false;
	}
	return true;
}
</script>
 <BODY>
	<form id="entityForm" name="entityForm" 
			action='<%=ApplicationPath%>/terminalParam/send.action' method="POST" onsubmit="return checkForm()">
				<!--超速设置-->
        <input type="hidden"  name="operation"  id="operation" value="modify"/>
        <input type="hidden"  name="vehicleId"  id="vehicleId" value="${vehicleId}"/>
  <table width="100%"  class="TableBlock">
					<tbody><tr>
						<td colspan="2" style="font-weight: bold; background: #EFEFEF;" height="25">疲劳驾驶参数设置
						<span style="color:red;background:blue;">${message}</span>
						</td>
					</tr>
					
					<tr>
						<td align="right">连续驾驶时间门限
							:</td>
						<td>
						<input type="hidden" name="paramId" value="0x0057" />
						<input type="hidden" id="param_1_value" name="paramValue" /><!--隐藏传值-->
						<input type="text" id="param_1"    maxlength="16" size="20"  value="240"
						   class="required digits">(分钟)
						  </td>
					</tr>
					<tr>
						<td align="right">当天累计驾驶时间门限:</td>
						<td >
						<input type="hidden" name="paramId" value="0x0058" />
						<input type="hidden" id="param_2_value" name="paramValue" /><!--隐藏传值-->
						<input type="text" id="param_2"   maxlength="16" size="20"  value="480"
						   class="required digits">(分钟)
						</td>
					</tr>
					<tr>
						<td align="right">最小休息时间:</td>
						<td >
						<input type="hidden" name="paramId" value="0x0059" />
						<input type="hidden" id="param_3_value" name="paramValue" /><!--隐藏传值-->
						<input type="text" id="param_3"    maxlength="16" size="20"  value="20"
						   class="required digits">(分钟)
						</td>
					</tr>
					<tr>
							<td align="right">疲劳驾驶预警差值:</td>
							<td >
							<input type="hidden" name="paramId" value="0x005C" />
							<input type="hidden" id="param_4_value" name="paramValue" /><!--隐藏传值-->
							<input type="text" id="param_4"   maxlength="16" size="20"  value="30"
							   class="required digits">(分钟)
							</td>
						</tr>
					<tr>

						<td colspan=2 align="center">
						   <input id="setSubmit" type="submit"  class="sendjson" value="设置">
						   <span class="commandMsg"></span></td>
						
					</tr>

				
					
				</tbody></table>
 </BODY>
</HTML>
